Fix field default value quoting and add column comment support#90
Merged
hidu merged 1 commit intohidu:masterfrom Oct 29, 2025
Merged
Conversation
- Add needsQuotedDefault() method to determine if field type requires quoted default values - Fix default value formatting for string types (char, varchar, text, etc.) - Add ColumnComment field to FieldInfo struct and include in schema comparison - Update field comparison to check column comments - Add comprehensive test cases for various field types with default values - Import slices package for type checking This fixes issues where: 1. String type default values were not properly quoted in DDL statements 2. Column comments were not synced between source and target databases 3. Field comparison could miss comment differences 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two critical issues in schema synchronization:
Changes
Core Improvements
needsQuotedDefault()method toFieldInfoto determine if a field type requires quoted default valuesFieldInfo.String()to handle:ColumnCommentfield toFieldInfostructFieldInfo.Equals()to include column comment comparisonCOLUMN_COMMENTfromINFORMATION_SCHEMA.COLUMNSTest Coverage
Problem Statement
Before this fix:
After this fix:
Additionally, column comments were completely ignored during schema comparison, causing synchronization to miss comment differences between source and target databases.
Testing
Tested with:
Related Issues
This fixes the issue where schema sync would generate invalid SQL statements for fields with string default values, and addresses the missing column comment synchronization feature.
🤖 Generated with Claude Code